package com.qk.management.mapper;

import com.qk.entity.Dept;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DeptMapper {

    @Delete("delete from dept where id = #{deptid}")
    void deleteById(Integer deptid);


//    @Update("update dept set name = #{name}, status = #{status}, update_time = #{updateTime} where id = #{id}")
    void updateDept(Dept dept);

    @Select("select * from dept where id = #{deptId}")
    Dept selectById(Integer deptId);

    List<Dept> list(@Param("name")String name, @Param("status") Integer status);

    @Insert("insert into dept( name, status, create_time, update_time) values(#{name},#{status},#{createTime},#{updateTime})")
    void insert(Dept dept);

    @Select("select * from dept")
    List<Dept> listDept();
}